<#include "/layout/header.ftl" />

<script>
	function password_click()
	{
		var obj = $.getObject("#div_form");
		if (obj.password != obj.password2)
		{
			$.toast("2次密码不一致", "forbidden");
			return;
		}

		$.simpleAjax("/admin/security/password", obj, function(o)
		{
			$.toast("修改成功", function()
			{
				window.location = "${path}/admin/security/index";
			});
		});
	}
</script>

<div class="weui-cells weui-cells_form" style="margin-top: 40px;" id="div_form">
	<div class="weui-cell">
		<div class="weui-cell__hd"><label class="weui-label">旧密码</label></div>
		<div class="weui-cell__bd">
			<input type="password" name="oldPassword" class="weui-input" placeholder="请输入旧密码" />
		</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__hd"><label class="weui-label">新密码</label></div>
		<div class="weui-cell__bd">
			<input type="password" name="password" class="weui-input" placeholder="请输入新密码" />
		</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__hd"><label class="weui-label">重复新密码</label></div>
		<div class="weui-cell__bd">
			<input type="password" name="password2" class="weui-input" placeholder="请重复输入新密码" />
		</div>
	</div>
</div>
<div class="weui-flex flex_padding">
	<div class="weui-flex__item">
		<a href="javascript:;" onclick="password_click()" class="weui-btn weui-btn_primary">修改</a>
	</div>
	<div class="weui-flex__item">
		<a href="${path}/admin/security/index" class="weui-btn weui-btn_plain-default">返回</a>
	</div>
</div>

<#include "/layout/footer.ftl" />